package book;

public class Book {
    public String bookname;
    public String author;
    public int page;
    public boolean borrowed = false;

    public Book(String bookname, String author, int page) {
        this.bookname = bookname;
        this.author = author;
        this.page = page;
    }

    public void setBorrowed(boolean borrowed) {
        this.borrowed = borrowed;
    }

    public String getBookname() {
        return bookname;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookname='" + bookname + '\'' +
                ", author='" + author + '\'' +
                ", page=" + page +
                ", " + (borrowed ? "已借出":"未借出")
                ;
    }
}
